<!DOCTYPE html>
<html>
<head>
    <title>RBAC</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}"/>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-theme.min.css') }}"/>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="#user" data-toggle="tab">User</a></li>
    <li><a href="#role" data-toggle="tab">Role</a></li>
    <li><a href="#authority" data-toggle="tab">Authority</a></li>
    <li><a href="#" data-toggle="tab" id="refresh">Refresh</a></li>
</ul>
<div class="tab-content">
    <div id="user" class="container tab-pane active">
        <legend>User</legend>
        <button class="btn btn-info" data-toggle="modal" data-target="#addUserModal">Add</button>
        <button class="btn btn-info" data-toggle="modal" data-target="#setRoleModal">Set Role</button>
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>Username</th>
                <th>Roles</th>
                <th>Authority</th>
                <th>Do</th>
            </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
    <div id="role" class="container tab-pane">
        <legend>Role</legend>
        <button class="btn btn-info" data-toggle="modal" data-target="#addRoleModal">Add</button>
        <button class="btn btn-info" data-toggle="modal" data-target="#setLevelModal">Set Level</button>
        <button class="btn btn-info" data-toggle="modal" data-target="#deleteLevelModal">Delete Level</button>
        <button class="btn btn-info" data-toggle="modal" data-target="#setAuthorityModal">Set Authority</button>
        <button class="btn btn-info" data-toggle="modal" data-target="#deleteRoleAuthorityModal">Delete Role Authority
        </button>
        <button class="btn btn-info" data-toggle="modal" data-target="#setIncompatiblesModal">Set Incompatibles</button>
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>Roles</th>
                <th>Own</th>
                <th>Inherit</th>
                <th>Do</th>
            </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>

    <div id="authority" class="container tab-pane">
        <legend>Authority</legend>
        <button class="btn btn-info" data-toggle="modal" data-target="#addAuthorityModal">Add</button>
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>name</th>
                <th>Do</th>
            </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
</div>
<!--<button style="display:none" data-toggle="modal" data-target="#loginModal"></button>-->
<div class="modal fade" id="loginModal" tabindex="-1" role="login" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Login</h4>
            </div>
            <div class="modal-body container">
                <form id="loginForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="username" class="col-sm-1 control-label">Username</label>

                        <div class="col-sm-4">
                            <input type="text" name="username" class="form-control" id="username"
                                   placeholder="Username">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="password" class="col-sm-1 control-label">Password</label>

                        <div class="col-sm-4">
                            <input type="password" name="password" class="form-control" id="password"
                                   placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="loginButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="addUserModal" tabindex="-1" role="addUser">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">AddUser</h4>
            </div>
            <div class="modal-body container">
                <form id="addUserForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="addUsername" class="col-sm-1 control-label">Username</label>

                        <div class="col-sm-4">
                            <input type="text" name="username" class="form-control" id="addUsername"
                                   placeholder="Username">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="addPassword" class="col-sm-1 control-label">Password</label>

                        <div class="col-sm-4">
                            <input type="password" name="password" class="form-control" id="addPassword"
                                   placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="addUserButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="setRoleModal" tabindex="-1" role="setRole">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">setRole</h4>
            </div>
            <div class="modal-body container">
                <form id="setRoleForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="setRoleUser" class="col-sm-1 control-label">Username</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="userId" id="setRoleUser"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="setRoleRole" class="col-sm-1 control-label">Password</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="roleId" id="setRoleRole"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="setRoleButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="addRoleModal" tabindex="-1" role="addUser">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">addRole</h4>
            </div>
            <div class="modal-body container">
                <form id="addRoleForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="addRoleName" class="col-sm-1 control-label">Name</label>
                        <div class="col-sm-4">
                            <input type="text" name="name" class="form-control" id="addRoleName"
                                   placeholder="name">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="addRoleContent" class="col-sm-1 control-label">Content</label>

                        <div class="col-sm-4">
                            <textarea name="content" class="form-control" id="addRoleContent"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="addRoleButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="setLevelModal" tabindex="-1" role="setLevel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">setLevel</h4>
            </div>
            <div class="modal-body container">
                <form id="setLevelForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="setLevelHigh" class="col-sm-1 control-label">High</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="highId" id="setLevelHigh"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="setLevelLow" class="col-sm-1 control-label">Low</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="lowId" id="setLevelLow"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="setLevelButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="deleteLevelModal" tabindex="-1" role="deleteLevel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">deleteLevel</h4>
            </div>
            <div class="modal-body container">
                <form id="deleteLevelForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="deleteLevelHigh" class="col-sm-1 control-label">High</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="highId" id="deleteLevelHigh"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="deleteLevelLow" class="col-sm-1 control-label">Low</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="lowId" id="deleteLevelLow"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="deleteLevelButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="setAuthorityModal" tabindex="-1" role="setAuthority">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">setAuthority</h4>
            </div>
            <div class="modal-body container">
                <form id="setAuthorityForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="setAuthorityRole" class="col-sm-1 control-label">Role</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="roleId" id="setAuthorityRole"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="setAuthorityAuthority" class="col-sm-1 control-label">Authority</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="authorityId" id="setAuthorityAuthority"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="setAuthorityButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="deleteRoleAuthorityModal" tabindex="-1" role="addUser">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">deleteRoleAuthority</h4>
            </div>
            <div class="modal-body container">
                <form id="deleteRoleAuthorityForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="setAuthorityRole" class="col-sm-1 control-label">Role</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="roleId" id="deleteRoleAuthorityRole"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="setAuthorityAuthority" class="col-sm-1 control-label">Authority</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="authorityId" id="deleteRoleAuthorityAuthority"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="deleteRoleAuthorityButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="setIncompatiblesModal" tabindex="-1" role="setIncompatibles">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">setIncompatibles</h4>
            </div>
            <div class="modal-body container">
                <form id="setIncompatiblesForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="setAuthorityRole" class="col-sm-1 control-label">One</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="oneId" id="setIncompatiblesOne"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="setAuthorityAuthority" class="col-sm-1 control-label">Another</label>

                        <div class="col-sm-4">
                            <select class="form-control" name="anotherId" id="setIncompatiblesAnother"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="setIncompatiblesButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="addAuthorityModal" tabindex="-1" role="addUser">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">addAuthority</h4>
            </div>
            <div class="modal-body container">
                <form id="addAuthorityForm" class="form-horizontal" role="form" method="post">
                    <div class="form-group">
                        <label for="addAuthorityName" class="col-sm-1 control-label">Name</label>

                        <div class="col-sm-4">
                            <input type="text" name="name" class="form-control" id="addAuthorityName"
                                   placeholder="name">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-3">
                            <button id="addAuthorityButton" type="submit" class="btn btn-default">submit</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="{{url_for('static', filename='js/jquery-2.1.1.js') }}"></script>
<script src="{{url_for('static', filename='js/bootstrap.min.js') }}"></script>
<script src="{{url_for('static', filename='js/index.js') }}"></script>
</body>
</html>

